package com.blackrock.das.enums;

/**
 * The Enum DataType.
 */
public enum DataType {
    /** The aum. */
    AUM("AUM"),

    /** The fund performance. */
    FUND_PERFORMANCE("fundReturn"),

    /** The index performance. */
    INDEX_PERFORMANCE("benchReturn"),

    /** The nav. */
    NAV("NAV"),

    /** The shares in issue. */
    SHARES_IN_ISSUE("sharesInIssue");

    /** The column name. */
    private final String columnName;

    /**
     * Instantiates a new data type.
     *
     * @param columnName the column name
     */
    private DataType(String columnName) {
        this.columnName = columnName;
    }

    /**
     * Gets the column name.
     *
     * @return the column name
     */
    public String getColumnName() {
        return columnName;
    }

    public static DataType getTypeForColumnName(String column) {
        for (DataType type : DataType.values()) {
            if (type.columnName.equals(column)) {
                return type;
            }
        }
        return null;
    }

}
